import {defineStore} from "pinia";
import {reactive, ref, toRaw} from "vue";

export const useCartStore = defineStore('cart', () => {
    const cartInfo = reactive({
        businessId:"",
        cartData:[],
        totalPrice:0
    })
    function setCartInfo(cartInfo) {
        this.cartInfo.businessId = cartInfo.businessId
        this.cartInfo.cartData = cartInfo.cartData
    }

    function setTotalPrice(price) {
        this.cartInfo.totalPrice = price
    }

    return { cartInfo, setCartInfo,setTotalPrice }
})